namespace GeoWeb.Demo.WorkDataConfig
{
    using System;
    using GeoWeb.DataContext;


    /// <summary>
    /// 表名：GeoInitWorkDay 主键列：
    /// </summary>
    [SerializableAttribute()]
    public partial class GeoInitWorkDay : Entity
    {

        protected Int32 _Init_ID;

        protected Int32? _Init_Year;

        protected Int32? _Init_Month;

        protected DateTime? _Init_FullDate;

        protected Int32? _Init_state;

        public Int32 Init_ID
        {
            get
            {
                return this._Init_ID;
            }
            set
            {
                this.OnPropertyValueChange(_.Init_ID, _Init_ID, value);
                this._Init_ID = value;
            }
        }

        public Int32? Init_Year
        {
            get
            {
                return this._Init_Year;
            }
            set
            {
                this.OnPropertyValueChange(_.Init_Year, _Init_Year, value);
                this._Init_Year = value;
            }
        }

        public Int32? Init_Month
        {
            get
            {
                return this._Init_Month;
            }
            set
            {
                this.OnPropertyValueChange(_.Init_Month, _Init_Month, value);
                this._Init_Month = value;
            }
        }

        public DateTime? Init_FullDate
        {
            get
            {
                return this._Init_FullDate;
            }
            set
            {
                this.OnPropertyValueChange(_.Init_FullDate, _Init_FullDate, value);
                this._Init_FullDate = value;
            }
        }

        public Int32? Init_state
        {
            get
            {
                return this._Init_state;
            }
            set
            {
                this.OnPropertyValueChange(_.Init_state, _Init_state, value);
                this._Init_state = value;
            }
        }

        /// <summary>
        /// 获取实体对应的表名
        /// </summary>
        protected override Table GetTable()
        {
            return new Table<GeoInitWorkDay>("GeoInitWorkDay");
        }

        /// <summary>
        /// 获取实体中的标识列
        /// </summary>
        protected override Field GetIdentityField()
        {
            return _.Init_ID;
        }

        /// <summary>
        /// 获取列信息
        /// </summary>
        protected override Field[] GetFields()
        {
            return new Field[] {
                        _.Init_ID,
                        _.Init_Year,
                        _.Init_Month,
                        _.Init_FullDate,
                        _.Init_state};
        }

        /// <summary>
        /// 获取列数据
        /// </summary>
        protected override object[] GetValues()
        {
            return new object[] {
                        this._Init_ID,
                        this._Init_Year,
                        this._Init_Month,
                        this._Init_FullDate,
                        this._Init_state};
        }

        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        protected override void SetValues(IRowReader reader)
        {
            if ((false == reader.IsDBNull(_.Init_ID)))
            {
                this._Init_ID = reader.GetInt32(_.Init_ID);
            }
            if ((false == reader.IsDBNull(_.Init_Year)))
            {
                this._Init_Year = reader.GetInt32(_.Init_Year);
            }
            if ((false == reader.IsDBNull(_.Init_Month)))
            {
                this._Init_Month = reader.GetInt32(_.Init_Month);
            }
            if ((false == reader.IsDBNull(_.Init_FullDate)))
            {
                this._Init_FullDate = reader.GetDateTime(_.Init_FullDate);
            }
            if ((false == reader.IsDBNull(_.Init_state)))
            {
                this._Init_state = reader.GetInt32(_.Init_state);
            }
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            if ((obj == null))
            {
                return false;
            }
            if ((false == typeof(GeoInitWorkDay).IsAssignableFrom(obj.GetType())))
            {
                return false;
            }
            if ((((object)(this)) == ((object)(obj))))
            {
                return true;
            }
            return false;
        }

        public class _
        {

            /// <summary>
            /// 表示选择所有列，与*等同
            /// </summary>
            public static AllField All = new AllField<GeoInitWorkDay>();

            /// <summary>
            /// 字段名：Init_ID - 数据类型：Int32
            /// </summary>
            public static Field Init_ID = new Field<GeoInitWorkDay>("Init_ID");

            /// <summary>
            /// 字段名：Init_Year - 数据类型：Nullable`1
            /// </summary>
            public static Field Init_Year = new Field<GeoInitWorkDay>("Init_Year");

            /// <summary>
            /// 字段名：Init_Month - 数据类型：Nullable`1
            /// </summary>
            public static Field Init_Month = new Field<GeoInitWorkDay>("Init_Month");

            /// <summary>
            /// 字段名：Init_FullDate - 数据类型：Nullable`1
            /// </summary>
            public static Field Init_FullDate = new Field<GeoInitWorkDay>("Init_FullDate");

            /// <summary>
            /// 字段名：Init_state - 数据类型：Nullable`1
            /// </summary>
            public static Field Init_state = new Field<GeoInitWorkDay>("Init_state");
        }
    }
}
